home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
extras
/
programm
/
gemfsc20
/
gemfsc20.lzh
/
GEMFUNCS
/
OBJPPSTR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-17
|
1KB
|
59 lines
/**************************************************************************
* OBJPPSTR.C - Return a pointer to an object's string pointer.
*************************************************************************/
#include "gemfintl.h"
char **obj_ppstring(pobj)
register OBJECT *pobj;
{
register short ob_type;
register _Ob_spec_t *pspec;
ob_type = pobj->ob_type & 0x00FF;
pspec = &pobj->_Ob_spec;
if (pobj->ob_flags & INDIRECT) {
pspec = (_Ob_spec_t *)(*pspec);
}
if (ob_type == G_USERDEF) {
register XUSERBLK *pxub = (XUSERBLK *)(*pspec);
if (pxub->ub_self == pxub) {
ob_type = pxub->ob_type;
pspec = &pxub->ob_spec;
}
}
switch (ob_type) {
case G_ICON:
pspec = (_Ob_spec_t *)(*pspec);
pspec = &pspec[2]; /* add 12-byte offset to pointer */
break;
case G_TEXT:
case G_BOXTEXT:
case G_FTEXT:
case G_FBOXTEXT:
pspec = (_Ob_spec_t *)(*pspec);
break;
}
return (char **)pspec;
}
char *obj_gstring(ptree, obj)
OBJECT *ptree;
short obj;
{
return *(obj_ppstring(&ptree[obj]));
}
void obj_sstring(ptree, obj, newstring)
OBJECT *ptree;
short obj;
char *newstring;
{
*(obj_ppstring(&ptree[obj])) = newstring;
}